
module Loader
  class MatchList
    def initialize
      clear
    end

    def clear
      @expressions = []
    end

    def add expr
      @expressions << expr
    end

    def contains expr
      @expressions.include? expr
    end

    def matches string
      @expressions.each { |e|
        return true if e.match string
      }
      false
    end
  end
end